<?php

require './init.php';

// You need to set the client email for all campaign operations
$api->client_email = 'client_1+adwords-api-usage@hyperactive.ro';

// Add a new Campaign
$campaign = $api->Campaigns()->newCampaign();
$campaign->name = 'Test campaign' . time();
$campaign->endDate = '20101010';
$campaign->status = 'PAUSED';
$campaign->biddingStrategy = 'ManualCPC';
$budget = $campaign->newBudget();
$budget->period = 'DAILY';
$budget->deliveryMethod = 'STANDARD';
$budget->setAmount('1000000', 'USD');
$campaign->budget = $budget;

$result = $api->Campaigns()->addNew($campaign);
var_dump($result);

// Get all campaigns
$campaignPage = $api->Campaigns()->getAll();
var_dump($campaignPage->getEntries());
